HTML5 Mobile Development Cookbook by unknow

HTML5 Mobile Development Cookbook by unknow

Author:unknow
Language: eng
Format: epub
Publisher: Packt Publishing


Getting ready

In this example, we will use a function in Mobile Boilerplate. Create a file called ch04r06.html.

How to do it...

The following code will create a form with a submit button:

<!doctype html> <html> <head> <title>first.fm</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> #contact { width:220px; height:40px; } </style> </head> <body> <header> <h1>Contact Form</h1> </header> <div id="main"> <textarea id="contact"></textarea><br /> <button id="btn">INSTANT button!!!</button><br /> <span id="result"></span> </div> <footer> <small>&copy; 2011 first.fm</small> </footer> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js"></script> <script src="//github.com/shichuan/mobile-html5-boilerplate/raw/master/js/mylibs/helper.js"></script> <script> var btn = document.getElementById("btn"); MBP.fastButton(btn,showForm); function showForm() { $("#result").html("Thank you for submitting, we will get back to you shortly!"); } </script> </body> </html>



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.